// pages/api_basic/api_basic.js
Page({

    /**
     * Page initial data
     */
    data: {

    },

    clickBtn:function (params) {
        wx.switchTab({
          url: '/pages/index/index?id=123',
        })
    },

    /**
     * Lifecycle function--Called when page load
     */
    onLoad: function (options) {
        // 获取系统型号信息
        console.log(wx.getSystemInfoSync()),

        // show loading
        wx.showLoading({
          title: 'Loading...',
        })

        setTimeout(res=> {
            wx.hideLoading()
        }, 1500)


        // 显示提示框
        wx.showToast({
          title: 'Success',
          duration: 3000
        })
    },

    /**
     * Lifecycle function--Called when page is initially rendered
     */
    onReady: function () {

    },

    /**
     * Lifecycle function--Called when page show
     */
    onShow: function () {

    },

    /**
     * Lifecycle function--Called when page hide
     */
    onHide: function () {

    },

    /**
     * Lifecycle function--Called when page unload
     */
    onUnload: function () {

    },

    /**
     * Page event handler function--Called when user drop down
     */
    onPullDownRefresh: function () {

    },

    /**
     * Called when page reach bottom
     */
    onReachBottom: function () {

    },

    /**
     * Called when user click on the top right corner to share
     */
    onShareAppMessage: function () {

    }
})